// AppIconView.m

/*
 * Copyright 1991 RightBrain Software.  All rights reserved.
 *
 * No part of this code may be reproduced in any form, compiled
 * or source code, nor used for any purpose without the express
 * written permission of RightBrain Software.
 * 
 * Entered into the public domain 12/15/93 by RightBrain Software.
 *
 */

#import <objc/List.h>
#import <dpsclient/psops.h>
#import <appkit/NXImage.h>

#import "AppIconView.h"

@implementation AppIconView


/* instance methods */

- initFrame:(NXRect *)frameRect
{
    [super initFrame:frameRect];
    
  /* construct the image list */
    imageList = [[List alloc] init];
    [imageList addObject:[NXImage findImageNamed:"app"]];
    [imageList addObject:[NXImage findImageNamed:"Acceptor30"]];
    [imageList addObject:[NXImage findImageNamed:"Acceptor60"]];
    [imageList addObject:[NXImage findImageNamed:"Acceptor90"]];
    
    return self;
}
    
- drawImage:(int)imageNumber
{
    currentImage = imageNumber;
    [self display];
    
  /* we do want to wait for our drawing to get flushed to the window server */
    NXPing();
    
    return self;
}

- drawSelf:(NXRect *)rects :(int)count
{
    NXPoint	point = {8.0, 8.0};
    
  /* erase */
    PSsetgray(NX_LTGRAY);
    NXRectFill(&bounds);
    
  /* image the right image */
    [[imageList objectAt:currentImage] composite:NX_SOVER
				       toPoint:&point];

    return self;
}

@end
